package cybertechcebu
{
	import cybertechcebu.enum.FileStatus;
	
	import flash.net.FileReference;
	
	public class LocalFile
	{
		private var _name:String;
		private var _size:int;
		private var _status:int;
		private var _fileRef:FileReference;
		private var _icon:String;
		
		private static const ICON_PLUS:String = "assets/plus.png";
		private static const ICON_CROSS:String = "assets/cross.png";
		private static const ICON_CHECK:String = "assets/check.png";
	
		public function LocalFile(fileRef:FileReference)
		{
			_name = fileRef.name;
			_size = fileRef.size;
			_status = FileStatus.ADDED;
			_fileRef = fileRef;
			_icon = ICON_PLUS;
		}
		
		public function get name():String
		{
			return _name;
		}
	
		public function get size():int
		{
			return _size;
		}
		
		public function get status():int
		{
			return _status;
		}
		
		public function set status(status:int):void{
			_status = status;
			
				if(status == FileStatus.SUCCESS){
					icon = ICON_CHECK;
				}else{
					icon = ICON_CROSS;
				}
		}
		
		public function get fileRef():FileReference{
			return _fileRef;
		}
		
		public function get isDir():Boolean{
			return false;
		}
		
		[Bindable]
		public function get icon():String{
			return _icon;
		}
		
		public function set icon(icon:String):void{
			_icon  = icon;
		}
	}
	
}
